using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace WIT.DAQ.Core.Forms;

/// <summary>
///
/// </summary>
internal class Log_AdvancedQueryForm : Form
{
	/// <summary>
	///
	/// </summary>
	/// <param name="fuzzyContent">需要模糊查询的日志明细Content</param>
	internal delegate void AdvancedQueryHandler(string fuzzyContent);

	/// <summary>
	/// Required designer variable.
	/// </summary>
	private IContainer components = null;

	private TextBox txtFuzzyContent;

	private Label label4;

	private Button btnQuery;

	private Button btnCancel;

	private Label lblNotice;

	/// <summary>
	///
	/// </summary>
	internal event AdvancedQueryHandler AdvancedQuery;

	/// <summary>
	///
	/// </summary>
	internal Log_AdvancedQueryForm()
	{
		InitializeComponent();
	}

	/// <summary>
	/// 查询
	/// </summary>
	/// <param name="sender"></param>
	/// <param name="e"></param>
	private void btnQuery_Click(object sender, EventArgs e)
	{
		if (txtFuzzyContent.Text.Trim() == string.Empty)
		{
			MessageBox.Show("请输入模糊查询的日志明细内容");
			return;
		}
		this.AdvancedQuery(txtFuzzyContent.Text);
		Close();
	}

	private void btnCancel_Click(object sender, EventArgs e)
	{
		Close();
	}

	/// <summary>
	/// Clean up any resources being used.
	/// </summary>
	/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
	protected override void Dispose(bool disposing)
	{
		if (disposing && components != null)
		{
			components.Dispose();
		}
		base.Dispose(disposing);
	}

	/// <summary>
	/// Required method for Designer support - do not modify
	/// the contents of this method with the code editor.
	/// </summary>
	private void InitializeComponent()
	{
		this.txtFuzzyContent = new System.Windows.Forms.TextBox();
		this.label4 = new System.Windows.Forms.Label();
		this.btnQuery = new System.Windows.Forms.Button();
		this.btnCancel = new System.Windows.Forms.Button();
		this.lblNotice = new System.Windows.Forms.Label();
		base.SuspendLayout();
		this.txtFuzzyContent.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
		this.txtFuzzyContent.Location = new System.Drawing.Point(125, 46);
		this.txtFuzzyContent.MaxLength = 0;
		this.txtFuzzyContent.Name = "txtFuzzyContent";
		this.txtFuzzyContent.Size = new System.Drawing.Size(195, 21);
		this.txtFuzzyContent.TabIndex = 0;
		this.label4.AutoSize = true;
		this.label4.Location = new System.Drawing.Point(30, 49);
		this.label4.Name = "label4";
		this.label4.Size = new System.Drawing.Size(89, 12);
		this.label4.TabIndex = 4;
		this.label4.Text = "模糊查询日志：";
		this.btnQuery.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right;
		this.btnQuery.Location = new System.Drawing.Point(246, 105);
		this.btnQuery.Name = "btnQuery";
		this.btnQuery.Size = new System.Drawing.Size(75, 23);
		this.btnQuery.TabIndex = 1;
		this.btnQuery.Text = "查询(&Q)";
		this.btnQuery.UseVisualStyleBackColor = true;
		this.btnQuery.Click += new System.EventHandler(btnQuery_Click);
		this.btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right;
		this.btnCancel.Location = new System.Drawing.Point(327, 105);
		this.btnCancel.Name = "btnCancel";
		this.btnCancel.Size = new System.Drawing.Size(75, 23);
		this.btnCancel.TabIndex = 2;
		this.btnCancel.Text = "取消(&C)";
		this.btnCancel.UseVisualStyleBackColor = true;
		this.btnCancel.Click += new System.EventHandler(btnCancel_Click);
		this.lblNotice.AutoSize = true;
		this.lblNotice.ForeColor = System.Drawing.Color.Red;
		this.lblNotice.Location = new System.Drawing.Point(123, 22);
		this.lblNotice.Name = "lblNotice";
		this.lblNotice.Size = new System.Drawing.Size(89, 12);
		this.lblNotice.TabIndex = 5;
		this.lblNotice.Text = "速度慢，慎用！";
		base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.ClientSize = new System.Drawing.Size(414, 140);
		base.Controls.Add(this.lblNotice);
		base.Controls.Add(this.btnQuery);
		base.Controls.Add(this.btnCancel);
		base.Controls.Add(this.txtFuzzyContent);
		base.Controls.Add(this.label4);
		base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
		base.KeyPreview = true;
		base.MaximizeBox = false;
		base.Name = "Log_AdvancedQueryForm";
		base.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
		this.Text = "日志模糊查询";
		base.ResumeLayout(false);
		base.PerformLayout();
	}
}
